package cn.factorybox.item.controller;

import cn.factorybox.common.entity.Result;
import cn.factorybox.item.annotation.ControllerLogAnnotation;
import cn.factorybox.item.service.CompanyService;
import cn.factorybox.model.entity.Company;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author flypig
 * @version 1.0
 * @date 2020-11-21 19:43
 */

@Api(tags = "公司管理")
@RestController
public class CompanyController {

    @Autowired
    private CompanyService companyService;

    @ControllerLogAnnotation(moduleName = "公司管理", functionName = "修改公司信息")
    @ApiOperation(value = "修改公司信息", notes = "修改公司信息")
    @PutMapping("/company")
    public Result updateCompany(@RequestBody Company company) {
        companyService.update(company);
        return Result.ok("修改公司信息成功");
    }

//    @ControllerLogAnnotation(moduleName = "公司管理", functionName = "删除公司成功")
//    @ApiOperation(value = "删除公司成功", notes = "删除公司成功")
//    @DeleteMapping("/company")
//    public Result updateCompany(@RequestParam("id") String id) {
//        companyService.delete(id);
//        return Result.ok("删除公司成功");
//    }

}
